//
//  DNGlobalContext.swift
//  LunalerApp
//
//  Created by 露乐ios on 2018/2/7.
//  Copyright © 2018年 露乐ios. All rights reserved.
//

import UIKit

class DNGlobalContext: NSObject {

    static let shareInstance = DNGlobalContext()
    private override init() {}
    
    func isNotFirstLaunchThisVesion() -> Bool {
        let versionStr = UserDefaults.standard.value(forKey: "setNotFirstLaunchThisVesion") as AnyObject
        if (versionStr is NSNull)
        {return false;}
        return versionStr as! String == String.init(format: "%@_YES", DNAppContext.shareInstance.appVersion)
    }
    
    func setNotFirstLaunchThisVesion(){
        UserDefaults.standard.dnUserDefaultSetValueForKey(value: String.init(format: "%@_YES", DNAppContext.shareInstance.appVersion) as AnyObject, key: "setNotFirstLaunchThisVesion")
        UserDefaults.standard.synchronize()
    }
    
    
}
